<?php 

/**
* Gavick News Image V - content template
* @package Joomla!
* @Copyright (C) 2008 Gavick.com
* @ All rights reserved
* @ Joomla! is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.0 $
**/

// access restriction
defined('_JEXEC') or die('Restricted access');
// calculating block width
$block_width = $this->module_width;

?>

<div class="gk_news_image_5_wrapper" id="gk_news_image_5-<?php echo $this->module_id;?>" style="width:<?php echo $block_width;?>px;<?php echo ($this->module_bg == '') ? '' : 'background-color: '.$this->module_bg.';'; ?>">

<div style="width:<?php echo $this->module_width;?>px;height:<?php echo $this->module_height;?>px;background-color:<?php echo $this->base_bgcolor;?>;overflow: hidden;position: relative;float: <?php echo (($this->tabs_position == 'left') ? 'right':'left');?>;margin-right: <?php echo $this->tabs_margin;?>px;">

<?php if($this->show_text_block == 1) : ?>
	<div class="gk_news_image_5_json"><?php echo $this->JSON;?></div>
<?php endif; ?>

<?php if($this->click_image) : ?>
	<div class="gk_news_image_5_json_links"><?php echo $this->JSONlinks;?></div>
<?php endif; ?>
		
<?php 
	$highest_layer = 0;
	
	for($i = 0; $i < count($this->slides); $i++)
	{
		echo '<div class="gk_news_image_5_slide" style="background-image:url('.$this->base_path_to_images.'/thumbm/'.$this->slides[$i]['name'].');width:'.$this->module_width.'px;height:'.$this->module_height.'px;position: absolute;z-index:'.$i.';"></div>';
		$highest_layer = $i;
	}
	
	$highest_layer += 5; 
?>

<?php if($this->show_text_block == 1) : ?>
	<?php $text_overlay_bgcolor = ($this->text_block_background == 0) ? $this->text_block_bgcolor : $this->base_bgcolor; ?>
		<div class="gk_news_image_5_text_bg" style="position: absolute;z-index:<?php echo $highest_layer;?>;background-color:<?php echo $text_overlay_bgcolor; ?>;opacity: <?php echo $this->text_block_opacity;?>;width: 100%;"></div>
		<?php $highest_layer += 1; ?>
		<div class="gk_news_image_5_text" style="position: absolute;z-index:<?php echo $highest_layer;?>;"></div>
<?php endif; ?>

</div>

<div class="gk_news_image_5_tabsbar_wrap" style="width:<?php echo $block_width;?>px;">
<ul class="gk_news_image_5_tabsbar">		

<?php
	for($i = 0;$i < count($this->slides);$i++)
	{
		$field = ($this->slides[$i]["title"] == '') ? "ctitle" : "title";
		echo '<li class="gk_news_image_5_tab"><span>'.$this->slides[$i][$field].'</span></li>';
	}	
?>

</ul>
</div>
</div>
